Ccay.Module.define("Ccay.example.ui.point",function(page,$S){
	page.ready=function(){
		//setTimeout 延迟加载 0 就是0秒  用延迟加载的原因就是避免加载发生冲突
		setTimeout(function(){$("#pointDemo").ccayTab()}, 200);
		
		$('#chart').chart({
			type:"point",
			lines:[{label: '月度利润',xField:'month',yField:'profit'},
			       {label: '月度支出',fnSetData:function(item){
			    	   return [item.month,item.profit - item.total]
			       } }
			],
			ajax:{
				url:'ccay/example/ui/chart/datas2.json'
			},
			fnClick:function(dataPoint){
				alert(dataPoint);
			}
		});
		
		$('#chart2').chart({
		  	type:"line-point",
			lines:[{label: '月度利润',xField:'month',yField:'profit'},
			       {label: '月度销售额',xField:'month',yField:'total'}
			],
			linesOp:{
				radius:2
			},
			ajax:{
				url:'ccay/example/ui/chart/datas2.json'
			}
		});
	};
});